import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import login from './views/login/index.vue'
import teacherdata from './views/teacherdata/index.vue'
import itembank from './views/itembank/index.vue'
import teacheritembankid from './views/itembank/teacheritembankid.vue'

import answer from './views/answer/index.vue'
import useranswer from './views/answer/useranswer.vue'
Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    name: 'home',
    component: Home,
    redirect: '/teacherdata',
    children: [{
      path: '/teacherdata',
      name: 'teacherdata',
      component: teacherdata,
    },
    {
      path: '/itembank',
      name: 'itembank',
      component: itembank,
    },
    {
      path: '/teacheritembankid/:ID',
      name: 'teacheritembankid',
      component: teacheritembankid,
      props: true
    },
    {
      path: '/answer',
      name: 'answer',
      component: answer,
    },
    {
      path: '/useranswer/:ID',
      name: 'useranswer',
      component: useranswer,
      props: true
    },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: login
  },

  ]
})